# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=python-bitcoinlib
pkgver=0.12.0
_tag=$pkgname-v$pkgver
pkgrel=1
pkgdesc='Python3 library providing an easy interface to the Bitcoin data structures and protocol'
arch=('any')
url='https://github.com/petertodd/python-bitcoinlib'
license=('GPL3')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_tag.tar.gz")
sha512sums=('4123b51978d90abb9b0d15eb0a75705e5a495469999221484c4d84e7e61a73ef147ea8d5d9b40fd2087101a2ebec42058804e5f8ba1d67128f3d9d329fed5544')

build() {
  cd $pkgname-$_tag

  python setup.py build
}

check() {
  cd $pkgname-$_tag

  python setup.py pytest
}

package() {
  cd $pkgname-$_tag

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
